package com.boarsoft.flow.service;

import com.boarsoft.flow.core.SimpleFlow;

/**
 * 为方便以服务形式暴露流程服务<br>
 * 
 * @author Mac_J
 *
 */
public interface SimpleFlowService {
	/**
	 * 
	 * @param flow
	 * @return
	 * @throws Throwable
	 */
	Object start(SimpleFlow flow) throws Throwable;

	/**
	 * 
	 * @param data
	 * @return
	 * @throws Throwable
	 */
	Object start(Object data) throws Throwable;

	/**
	 * 
	 * @param id
	 * @return
	 * @throws Throwable
	 */
	Object resume(String id) throws Throwable;

	/**
	 * 
	 * @param id
	 * @param exData
	 * @return
	 * @throws Throwable
	 */
	Object resume(String id, Object exData) throws Throwable;

	/**
	 * 
	 * @return
	 * @throws Throwable
	 */
	SimpleFlow create() throws Throwable;
}
